<?php
/*
 * 组合模式
 */
abstract class makeYiFu{
    abstract function buyMianHua();
    abstract function zhiBu();
    abstract function xiuJia();
    abstract function fengHe();
}
class fatory extends makeYiFu{
    function buyMianHua(){
        echo "1:买布";
    }
    function zhiBu(){
        echo "2:zhi布";
    }
    function xiuJia(){
        echo "3:裁剪";
    }
    function fengHe(){
        echo "4:缝合";
    }
}
class client{
    public $factory;
    public function __construct()
    {
        $this->factory = new fatory();
    }
    function make(){
        $this->factory->buyMianHua();
        $this->factory->zhiBu();
        $this->factory->xiuJia();
        $this->factory->fengHe();
    }
}